<%@ include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Function Information</title>
<link rel="stylesheet" type="text/css" href="<c:url value='/styles/${appConfig["csstheme"]}/style.css'/>">
<script src="../js/common.js"></script>
</head>
<body> 
<table border="0" cellspacing="0" cellpadding="0" class="width100">
  <tr>
  	<td style="width:5px; font-size:0px; line-height:0px; background-color:#A5C331;">&nbsp;</td>
    <td class="right_topbar"><bean:message key="menu.manager.title.funcInfo"/></td>
  </tr>
</table>
<html:form action="funcAction.html" >
<table border="0" cellspacing="0" cellpadding="10" class="width100">
  <tr>
    <td style="padding-top:0px; padding-top:5px;">
  <table border="0" cellspacing="0" cellpadding="2" class="list">
    <tr class="top">
    <td width="40">ID</td>
    <td width="80"><bean:message key="manager.common.func.name"/></td>
    <td width="200"><bean:message key="manager.common.func.url"/></td>
    <td width="40"><bean:message key="manager.common.func.action"/></td>
    <td><bean:message key="manager.common.func.memo"/></td>
    <td width="80"><bean:message key="manager.common.func.isUsable"/></td>
    <td width="80"><bean:message key="manager.common.func.select"/></td>
   </tr>
   
   <logic:notEmpty name="funcInfoList">
  <logic:iterate id="results" name="funcInfoList" indexId="index">
   <tr>
   <td><bean:write name="results" property="id"/></td>
   <td>&nbsp;<bean:write name="results" property="name"/></td>
   <td>&nbsp;<bean:write name="results" property="url"/></td>
   <td>&nbsp;<bean:write name="results" property="action"/></td>
   <td>&nbsp;<bean:write name="results" property="memo"/></td>
   <logic:equal name="results" property="isUsable" value="1">
   <td>&nbsp;<bean:message key="radio.button.yes"/></td>
   </logic:equal>
   <logic:equal name="results" property="isUsable" value="0">
   <td>&nbsp;<bean:message key="radio.button.no"/></td>
   </logic:equal>
   
   <td><div align="center">
     <input type="checkbox" name="id" value="<bean:write name="results" property="id"/>" />
   </div></td>
  </tr>
</logic:iterate>
</logic:notEmpty>  
  
  </table>

    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="padding10px">&nbsp;</td>
      </tr>
    </table>
    
    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
      
        <td class="but_left">&nbsp;</td>
        <td class="but_mid"><a href="#" onclick="javascript:submitData('selectOne');"><bean:message key="button.edit"/></a></td>
        <td class="but_right">&nbsp;</td>
        <td class="but_kong">&nbsp;</td>
         
        <td class="but_left">&nbsp;</td>
        <td class="but_mid"><a href="newFuncPage.html" ><bean:message key="button.add"/></a></td>
        <td class="but_right">&nbsp;</td>
        <td class="but_kong">&nbsp;</td>
        
        <td class="but_left">&nbsp;</td>
        <td class="but_mid"><a href="#" onclick="javascript:submitData('delete');"><bean:message key="button.delete"/></a></td>
        <td class="but_right">&nbsp;</td>
        <td class="but_kong">&nbsp;</td>
         
      </tr>
    </table>
	</td>
  </tr>
</table>
<input type="hidden" name="method">
<input type="hidden" name="message" value="<bean:message key="errors.func.select"/>">
<html:hidden property="aryId"/>
</html:form>
<script>
  function submitData(method){
	
		var chk = document.forms[0].id;
		var len = chk.length;
		var ary = new Array();
	    //alert(len.lenth);
		document.forms[0].method.value=method;
		if(len>0){
		
		for(var i=0;i<len;i++){
			if(chk[i].checked){
				ary.push(chk[i].value);
			}
		}
		var aryAy = ary; 
		document.forms[0].aryId.value = aryAy;
		//alert("len>0 and checked");
		document.forms[0].submit();
		//return;
		}else{
		//alert("len<=0");
		if(chk.checked){
		document.forms[0].aryId.value = chk.value;
		document.forms[0].submit();
		return;
		}
	}
	    if(ary.length==0)
		{alert(document.forms[0].message.value);}
		
	}
	function delSubmit(){ 
	
	document.forms[0].submit();
    }
	
</script>
</body> 
</html>